package com.cr.web.controller.api;

import com.cr.business.service.TbRegionService;
import com.cr.common.core.domain.AjaxResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 地区查询控制类
 */
@RestController
@RequestMapping("api/region")
public class RegionController {

    @Resource
    private TbRegionService regionService;

    /**
     * 获取地区数据
     */
    @GetMapping("getRegionData")
    public AjaxResult getRegionData(String parent){
        return AjaxResult.success(regionService.getRegionDatas(parent));
    }

}
